/*
 * __NAME__.java
 *
 * Created on 28 de septiembre de 2008, 11:13 PM
 */
 
package com.dyg.geovisor;

import com.dyg.geovisor.bean.SiteBean;
import com.dyg.geovisor.facade.GeoVisorFacade;
import java.util.List;
import javax.faces.event.ActionEvent;

/** 
 *
 * @author Administrador
 * @version 
 */

public class HomeBackendBean {

    private String text;
    private GeoVisorFacade facade;
    private List<SiteBean> sites;

    public List<SiteBean> getSites() {
        return sites;
    }

    public void setSites(List<SiteBean> sites) {
        this.sites = sites;
    }
    
    public HomeBackendBean() {
        facade = new GeoVisorFacade();
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
    
    public void search(ActionEvent ev){
        List<SiteBean> results = facade.searchAddress(text);
//        for (SiteBean siteBean : results) {
//            this.text = siteBean.getAddress();
//        }
        sites = results;
    }

}
